package com.kaili.basic.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.kaili.basic.mapper.ReportFormMapper;
import com.kaili.basic.pojo.dto.*;
import com.kaili.basic.pojo.vo.*;
import com.kaili.basic.service.IReportFormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReportFormServiceImpl implements IReportFormService {
    @Autowired
    private ReportFormMapper reportFormMapper;

    @Override
    public Page<InventoryCapacityVo> inventoryCapacity(Page<InventoryCapacityVo> page,Integer storeId) {
        List<InventoryCapacityVo> inventoryCapacityVos = reportFormMapper.inventoryCapacity(storeId);
        return page.setRecords(inventoryCapacityVos);
    }

    @Override
    public List<InventoryCapacityVo> exportInventoryCapacity(InventoryCapacityDto inventoryCapacityDto) {
        return reportFormMapper.inventoryCapacity(inventoryCapacityDto.getStoreId());
    }

    @Override
    public Page<InventoryWarningVo> inventoryWarning(Page<InventoryWarningVo> page, InventoryWarningDto inventoryWarningDto) {
        List<InventoryWarningVo> inventoryWarningVos = reportFormMapper.inventoryWarning(inventoryWarningDto);
        return page.setRecords(inventoryWarningVos);
    }

    @Override
    public List<InventoryWarningVo> exportInventoryWarning(InventoryWarningDto inventoryWarningDto) {
        return reportFormMapper.inventoryWarning(inventoryWarningDto);
    }

    @Override
    public Page<TurnoverRateVo> turnoverRate(Page<TurnoverRateVo> page, TurnoverRateDto turnoverRateDto) {
        List<TurnoverRateVo> turnoverRateVos = reportFormMapper.turnoverRate(turnoverRateDto);
        return page.setRecords(turnoverRateVos);
    }

    @Override
    public List<TurnoverRateVo> exportTurnoverRate(TurnoverRateDto turnoverRateDto) {
        return reportFormMapper.turnoverRate(turnoverRateDto);
    }

    @Override
    public Page<LeaseCostVo> leaseCost(Page<LeaseCostVo> page, LeaseCostDto leaseCostDto) {
        List<LeaseCostVo> leaseCostVos = reportFormMapper.leaseCost(leaseCostDto);
        return page.setRecords(leaseCostVos);
    }

    @Override
    public List<LeaseCostVo> exportLeaseCost(LeaseCostDto leaseCostDto) {
        return reportFormMapper.leaseCost(leaseCostDto);
    }

    @Override
    public Page<InventoryLedgerVo> inventoryLedger(Page<InventoryLedgerVo> page, InventoryLedgerDto inventoryLedgerDto) {
        List<InventoryLedgerVo> inventoryLedgerVos = reportFormMapper.inventoryLedger(inventoryLedgerDto);
        return page.setRecords(inventoryLedgerVos);
    }

    @Override
    public List<InventoryLedgerVo> exportInventoryLedger(InventoryLedgerDto inventoryLedgerDto) {
        return reportFormMapper.inventoryLedger(inventoryLedgerDto);
    }

    @Override
    public Page<BeginAndEndVo> beginAndEnd(Page<BeginAndEndVo> page, BeginAndEndDto beginAndEndDto) {
        List<BeginAndEndVo> beginAndEndVos = reportFormMapper.beginAndEnd(beginAndEndDto);
        return page.setRecords(beginAndEndVos);
    }

    @Override
    public List<BeginAndEndVo> exportBeginAndEnd(BeginAndEndDto beginAndEndDto) {
        return reportFormMapper.beginAndEnd(beginAndEndDto);
    }

    @Override
    public Page<OutOfStockVo> outOfStock(Page<OutOfStockVo> page, OutOfStockDto outOfStockDto) {
        List<OutOfStockVo> outOfStockVos = reportFormMapper.outOfStock(outOfStockDto);
        return page.setRecords(outOfStockVos);
    }

    @Override
    public List<OutOfStockVo> exportOutOfStock(OutOfStockDto outOfStockDto) {
        return reportFormMapper.outOfStock(outOfStockDto);
    }

    @Override
    public Page<InventoryVo> inventory(Page<InventoryVo> page, InventoryDto inventoryDto) {
        List<InventoryVo> inventoryVos = reportFormMapper.inventory(inventoryDto);
        return page.setRecords(inventoryVos);
    }

    @Override
    public List<InventoryVo> exportInventory(InventoryDto inventoryDto) {
        return reportFormMapper.inventory(inventoryDto);
    }
}
